home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Backup, Restoration & File Management
/
SyncBack SE 5.1
/
SyncBackSE_Setup.exe
/
{app}
/
IsDriveReady.vbs
< prev
next >
Wrap
Text File
|
2007-11-21
|
981b
|
40 lines
' IsDriveReady by Dave Wilkins 2007
' either preload the drive letter in question (in which
' case suggest rename the script IsDriveXReady.vbs...)
DLetter = "X"
' OR
' Set objArgs = WScript.Arguments
' DLetter = objArgs.Item(0)
' Cater for anyone who has "helpfully" included : or \
' DLetter = Left(DLetter,1)
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives ' drive collection
Do
For Each d In dc ' scan the drives looking for DLetter
If d.DriveLetter = DLetter Then
retval = 0 ' "OK" value for SBSE to proceed
Exit Do
End If
Next
' we have a non-ready drive
retval = MsgBox ("Please insert (or turn on) external drive " & DLetter, vbRetrycancel+Vbdefaultbutton1,"Backup Drive Not Ready")
If retval = VBCancel Then '
retval = 1 ' not OK (in SBSE-speak - diff val to VBCancel)
Exit Do
End If
Loop ' scan again; if still not ready, keep alerting till cancelled
Wscript.quit(retval)